﻿using System;
using System.Windows.Forms;

namespace mVu
{
  public static class Utilities
  {
    public static void HandleError(Exception ex)
    {
      MessageBox.Show(ex.Message, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
    }
  }

  public static class ThreadingExtensions
  {
    public static void InvokeIfRequired(this Control control, Action action)
    {
      if (control.InvokeRequired)
      {
        control.Invoke(action);
      }
      else
      {
        action();
      }
    }
  }
}
